---
--- Created by root.
--- DateTime: 17-11-21 上午10:51
---

local _OBJ = {}
_OBJ.content = ""
_OBJ.display = function(self, view_list, args)
    self.content = ""
   local view_content = {}
   for i, v in ipairs(view_list) do
      view_content[v] = require("app.view." ..v)
      self.content = self.content ..view_content[v]

   end
    self:parseParam(args)

   return self.content
end

_OBJ.parseParam = function(self,args)
    ngx.ctx.tpl_args = args
    --解析网页真实内容
    self.content = loadstring("return [[ "..string.gsub(self.content,"{{wl:(.-)}}",function(arg) return "]]..ngx.ctx.tpl_args."..arg.."..[[" end) .. "]]")()
    --解析函数
    return self.content
end

return _OBJ